import style from "./index.module.scss";
import Success from "@/assets/images/daily-recharge/success.png";
import Failed from "@/assets/images/daily-recharge/failed.png";
import { useNavigate } from "react-router-dom";

const PayResult = ({ result }) => {
  const navigate = useNavigate();
  return (
    <div className={style.resultContainer}>
      <div className={style.resultContent}>
        <img src={result === 1 ? Success : Failed} alt="背景图" />
        <p className={style.text}>{result === 1 ? "支付成功" : "支付失败"}</p>
        <div
          className={`${style.btn} ${style.disabled}`}
          onClick={() => {
            navigate(-1);
          }}
        >
          返回
        </div>
      </div>
    </div>
  );
};

export default PayResult;
